﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Logic.ClarizenSvc;
using Logic.ClarizenObjects;

namespace Logic.ClarizenObjects
{
    public class Email: BaseObject
    {
        public String Comment { get; set; }
        public String Subject { get; set; }
        public GenericEntity AttachedTo { get; set; }
        [Clarizen(Selectable = true, Editable = false)]
        public GenericEntity CreatedBy { get; set; }
        [Clarizen(Selectable = true, Editable = false)]
        public DateTime CreatedOn { get; set; }
        [Clarizen]
        public String CreatedOnString { get { return CreatedOn == null ? null : CreatedOn.ToString("MM/dd/yy"); } }
        [Clarizen(Selectable = true, Editable = false)]
        public String CreatedBy_Name { get { return CreatedBy == null ? null : CreatedBy.GetFieldValue("Name"); } }
        
        [Clarizen]
        public String recipient_cc_email { get; set; }
        [Clarizen]
        public long date_received { get; set; }
        [Clarizen]
        public String message_id { get; set; }
        [Clarizen]
        public String recipient_to_email { get; set; }
        [Clarizen]
        public String sender_email { get; set; }
        [Clarizen]
        //public String email_body { get { return PlainText; } set {PlainText=value ;} }
        //public long date_sent { get { return CreatedOn.Ticks; } set { CreatedOn = new DateTime(value);} }

        public Email(GenericEntity entity)
            : base(entity)
        {
            
        }

        public Email()
        {
        }
        
    }
}
